package com.wyx.controller;


import com.wyx.entity.Student;
import com.wyx.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 王云翔
 * @since 2022-03-08
 */
@RestController
@RequestMapping("/student")
public class StudentController {
    @Autowired
    private StudentService service;

    @GetMapping("/select")

    public Map<String, Object> selectAll(){
        List<Student> list = service.list();
        return new HashMap<String, Object>(){{
           put("stutas","success");
           put("student",list);
        }};
    }
}

